/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.subsystems;

import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.templates.commands.ConveyorLift;

public class Conveyor extends Subsystem {
    // Put methods for controlling this subsystem
    // here. Call these from Commands.
    private SpeedController motor;
    private Relay gate;

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
        setDefaultCommand(new ConveyorLift());
    }
    public Conveyor(){
        motor = new Jaguar(RobotMap.conveyorMotor);
        gate = new Relay(RobotMap.gateActuator);
    }

    public void conveyStop(){
        motor.set(0.0);
    }

    public void SetSpeed(double speed){
        motor.set(-speed);
    }

    public void latchgate(){
        gate.set(Relay.Value.kForward);
    }

    public void opengate(){
        gate.set(Relay.Value.kOff);
    }
}